#include <curl/curl.h>
#include <stdlib.h>
#include <string.h>
//size_t write_data(void *buffer, size_t size, size_t nmemb, void *userp) {
//	printf("*** write_data has been called: %d bytes,%s\n", size * nmemb,
//			buffer);
//	return size * nmemb;
//}
#define CHECKCC(x) \
if ((cc = x) != CURLE_OK) {\
	printf("Failed at line %d with code %d\n", __LINE__, cc); \
	exit(1); \
}
int umain() {
	/*
	CURLcode cc;
	const char *url = "http://localhost/webdav/Temp/";
	const char *userpwd = "Sco:sco";
	const char *method = "PROPFIND";
	struct curl_slist *slist = NULL;
	slist = curl_slist_append(slist, "Accept: text/xml");
	slist = curl_slist_append(slist, "Depth: 1");
	slist = curl_slist_append(slist, "Content-Type: text/xml");
	slist = curl_slist_append(slist, "Connection: Keep-Alive");
//	const char *postdata =
//			"<?xml version=\"1.0\"?><D:searchrequest xmlns:D=\"DAV:\" >"
//					"<D:sql>SELECT \"http://schemas.microsoft.com/repl/contenttag\""
//					" from SCOPE ('deep traversal of \"/wxcurl/\"') "
//					"WHERE \"DAV:isfolder\" = True</D:sql></D:searchrequest>\r\n";
	CHECKCC(curl_global_init(CURL_GLOBAL_SSL))
	CURL *pcurl = curl_easy_init();
//	CHECKCC(curl_easy_setopt(pcurl, CURLOPT_VERBOSE, 1))
	CHECKCC(curl_easy_setopt(pcurl, CURLOPT_URL, url))
	CHECKCC(curl_easy_setopt(pcurl, CURLOPT_CUSTOMREQUEST, method))
	CHECKCC(curl_easy_setopt(pcurl, CURLOPT_HTTPHEADER, slist))
//	CHECKCC(curl_easy_setopt(pcurl, CURLOPT_POSTFIELDS, postdata))
//	CHECKCC(curl_easy_setopt(pcurl, CURLOPT_POSTFIELDSIZE, strlen(postdata)))
	CHECKCC(curl_easy_setopt(pcurl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC))
	CHECKCC(curl_easy_setopt(pcurl, CURLOPT_USERPWD, userpwd))
//	CHECKCC(curl_easy_setopt(pcurl, CURLOPT_WRITEFUNCTION, write_data))
	CHECKCC(curl_easy_perform(pcurl))
	curl_slist_free_all(slist);
	*/
	return 1;
}
